const path = require('path')
const pxToViewport = require('postcss-px-to-viewport')

module.exports = {
  // webpack 配置
  webpack: {
    // 配置别名
    alias: {
      // 约定：使用 @ 表示 src 文件所在路径
      '@': path.resolve(__dirname, 'src'),
      '@scss': path.resolve(__dirname, 'src/assets/styles')
    },
  },
  // react-scripts 是 5.0 时的写法
  style: {
    postcss: {
      mode: "extends",
      loaderOptions: {
        postcssOptions: {
          ident: "postcss",
          plugins: [pxToViewport({ viewportWidth: 375 })],
        },
      },
    },
  },
}